<%@ page language="java" import="java.util.*,com.inspur.bean.User,com.inspur.bean.Address" pageEncoding="UTF-8" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'EL01.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
	<%
		//获取JavaBean的属性
		User user=new User(1,"张三",20);
		request.setAttribute("user1", user);
	
		Address address=new Address("山东省","济南市","明水街道"); 
		User user2=new User(2,"李四",24,address);
		request.setAttribute("user2", user2);
		
		//获取数组
		String[] likes={"游戏","篮球","学习"};
		User user3=new User();
		user3.setLikes(likes);
		request.setAttribute("user3", user3);
		
		//获取list集合
		List<String> language=new ArrayList<String>();
		language.add("Java语言");
		language.add("C语言");
		language.add("C++");
		User user4=new User();
		user4.setLanguage(language);
		request.setAttribute("user4", user4);
		
		//获取map
		Map<String,Double> map=new HashMap<String,Double>();
		map.put("a.b",8000.00);
		map.put("王五",9000.00);
		map.put("李四",10000.00);
		request.setAttribute("map",map);
		
		
		
		
	 %>
	 
	 用户的姓名1：${user1.userName}<br/>
	 用户的姓名2：${user1["userName"]}<br/>
	 用户的姓名3：${user1['userName']}<br/>
	 用户所在的城市：${user2.address.city }<br/>
	 用户所在的街道：${user2.address.street}<br/>
	用户的爱好1：${user3.likes[1] }<br/>
	用户的爱好2：${user3.likes['0'] }<br/>
	用户的爱好3：${user3.likes["2"] }<br/>
	
	用户掌握的语言1：${user4.language[0] }<br/>
	用户掌握的语言2：${user4.language['1'] }<br/>
	用户掌握的语言3：${user4.language["2"] }<br/>
	用户的薪水1：${map.李四}<br/>
	用户的薪水2：${map['李四']}<br/>
	用户的薪水3：${map["李四"]}<br/>
	用户的薪水1：${map['a.b'] }
  </body>
</html>
